﻿<%@ Page Language="C#" MasterPageFile="~/DigitalTV.Master" AutoEventWireup="true" CodeBehind="ManterEpisodio.aspx.cs" Inherits="UI.ManterEpisodio" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id = "Principal" style="width:499px; height: 544px;">
        <div id = "Consulta" style="width:501px">
            <table border="1">
                <tr>
                    <td colspan="2">
                        CONSULTA:&nbsp; </td>
                </tr>
                <tr>
                    <td colspan="2">
                        NOME:&nbsp;
                        <asp:TextBox ID="tbNomeConsulta" runat="server" Width="279px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:CheckBox ID="cbPayperviewConsulta" runat="server" Text="Payperview" />
                    </td>
                </tr>
                <tr>
                    <td>
                        PROGRAMA:</td>
                    <td class="style2">
                        <asp:DropDownList ID="ddlProgramaConsulta" runat="server" Height="28px" Width="231px" 
                            style="text-align: center" DataSourceID="ObjectDataSource1" 
                            DataTextField="tx_Nome" DataValueField="nr_ID" AppendDataBoundItems="True">
                            <asp:ListItem Value="0">Selecione Programa</asp:ListItem>
                        </asp:DropDownList>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                            DeleteMethod="Delete" InsertMethod="Insert" 
                            OldValuesParameterFormatString="original_{0}" SelectMethod="GetTodos" 
                            TypeName="Dados_.DigitalTVDSTableAdapters.T_ProgramaTableAdapter" 
                            UpdateMethod="Update">
                            <DeleteParameters>
                                <asp:Parameter Name="Original_nr_ID" Type="Int32" />
                            </DeleteParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="tx_Nome" Type="String" />
                                <asp:Parameter Name="nr_Tema" Type="Int32" />
                                <asp:Parameter Name="tt_Duração" Type="DateTime" />
                                <asp:Parameter Name="tx_Sinpose" Type="String" />
                                <asp:Parameter Name="Original_nr_ID" Type="Int32" />
                            </UpdateParameters>
                            <InsertParameters>
                                <asp:Parameter Name="tx_Nome" Type="String" />
                                <asp:Parameter Name="nr_Tema" Type="Int32" />
                                <asp:Parameter Name="tt_Duração" Type="DateTime" />
                                <asp:Parameter Name="tx_Sinpose" Type="String" />
                            </InsertParameters>
                        </asp:ObjectDataSource>
                        <asp:Button ID="btConsultar" runat="server" onclick="btConsultar_Click" 
                            Text="Consultar" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        EPISÓDIOS:<asp:ObjectDataSource ID="odsEpisodio" runat="server" 
                            DataObjectTypeName="Negocios.EpisodioBO" DeleteMethod="Remover" 
                            InsertMethod="Inserir" OldValuesParameterFormatString="original_{0}" 
                            SelectMethod="Consultar" TypeName="Negocios.EpisodioBOMetodos" 
                            UpdateMethod="Alterar">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="tbNomeConsulta" Name="nome" 
                                    PropertyName="Text" Type="String" />
                                <asp:ControlParameter ControlID="cbPayperviewConsulta" Name="payperview" 
                                    PropertyName="Checked" Type="Boolean" />
                                <asp:ControlParameter ControlID="ddlProgramaConsulta" Name="IDprograma" 
                                    PropertyName="SelectedValue" Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        <asp:GridView ID="gdEpisodio" runat="server" Height="204px" Width="397px" 
                            AllowPaging="True" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" 
                            BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataSourceID="odsEpisodio" 
                            ForeColor="Black" GridLines="None" 
                            onselectedindexchanged="gdEpisodio_SelectedIndexChanged">
                            <FooterStyle BackColor="Tan" />
                            <Columns>
                                <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                                <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                                <asp:CheckBoxField DataField="Payperview" HeaderText="Payperview" 
                                    SortExpression="Payperview" />
                                <asp:BoundField DataField="Preco" HeaderText="Preco" SortExpression="Preco" />
                                <asp:BoundField DataField="Sinopse" HeaderText="Sinopse" 
                                    SortExpression="Sinopse" />
                                <asp:BoundField DataField="Tempo" HeaderText="Tempo" SortExpression="Tempo" />
                                <asp:TemplateField HeaderText="Remover">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lbRemover" runat="server" onclick="lbRemover_Click">Remover</asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Atualizar">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lbAtualizar" runat="server" onclick="lbAtualizar_Click">Atualizar</asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                                HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                            <HeaderStyle BackColor="Tan" Font-Bold="True" />
                            <AlternatingRowStyle BackColor="PaleGoldenrod" />
                        </asp:GridView>
                    </td>
                </tr>
                </table>
        </div>
        <div id = "Cadastro" class="divDados" style="width:400px">
            <table border="1">
                <tr>
                    <td colspan="2">
                        <asp:Button ID="btNovo" runat="server" Text="Novo" Width="114px" 
                            onclick="btNovo_Click" />
                    </td>
                </tr>
                <tr>
                    <td>
                        ID:</td>
                    <td class="style1">
                        <asp:TextBox ID="tbID" runat="server" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        NOME:</td>
                    <td class="style1">
                        <asp:TextBox ID="tbNome" runat="server" Width="231px" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        PROGRAMA:</td>
                    <td class="style1">
                        <asp:DropDownList ID="ddlPrograma" runat="server" Height="29px" Width="231px" 
                            Enabled="False" DataSourceID="ObjectDataSource1" DataTextField="tx_Nome" 
                            DataValueField="nr_ID">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        SINOPSE:</td>
                    <td class="style1">
                        <asp:TextBox ID="tbSinopse" runat="server" Height="45px" TextMode="MultiLine" 
                            Width="231px" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        TEMPO:</td>
                    <td class="style1">
                        <asp:TextBox ID="tbTempo" runat="server" Width="231px" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        PAY-PER-VIEW</td>
                    <td class="style1">
                        <asp:CheckBox ID="cbPayperview" runat="server" Enabled="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        PREÇO:</td>
                    <td class="style1">
                        <asp:TextBox ID="tbPreco" runat="server" Width="231px" Enabled="False"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="btSalvar" runat="server" Text="Salvar" Width="114px" 
                            Enabled="False" onclick="btSalvar_Click" />
                        <asp:Button ID="btCancelar" runat="server" Enabled="False" 
                            onclick="btCancelar_Click" Text="Cancelar" Width="81px" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="head">

    <style type="text/css">
        .style1
        {
            width: 362px;
        }
        .style2
        {
            width: 321px;
        }
    </style>

</asp:Content>
